<?
/**
 * 文章详细页
 * 
 * @copyright Copyright (c) 2008 sdmblog (http://www.sdmblog.cn)
 * @author sdomain(sdomain@live.cn)
 * @version article.php Sun May 18 14:07:57 CST 2008 php $
 */
include_once('./include/common.inc.php');
include_once('./model/article.model.php');
include_once ("./xajax/inc/xajax.inc.php");

//根据文章编号显取出文章信息-此处做缓存-回复和其它信息用ajax
$aid = $_GET['id'];
if (!is_numeric($aid)) {
	alert('错误的文章编号');
}
$article = new model_article();
$articleinfo = $article->getArticle($aid);
if ($article->queryCount==0) {
	$article = null;
	alert('文章不存在或错误的文章编号');
}
$article = null;
$smarty->assign('aid',$aid);
$articleinfo['content'] = getHtmlContent($articleinfo['content']);
$smarty->assign('article',$articleinfo);


$xajax = new xajax('/'.$virdir."class/article.class.php");
//文章回复
$xajax->registerFunction('getArticleComment');
//显示分类列表
$xajax->registerFunction('getCategoryList');
//日历
$xajax->registerFunction('getCalendar');
//显示最新文章
$xajax->registerFunction('getRecentArticles');
//显示回复
$xajax->registerFunction('getComment');
//网站统计
$xajax->registerFunction('getStats');
//友情连接
$xajax->registerFunction('getLinks');
//用户登录
$xajax->registerFunction('userLogin');
//文章读取记数器
$xajax->registerFunction('addViews');
//发表回复
$xajax->registerFunction('addComment');

$ajaxscript=$xajax->getJavascript('/'.$virdir.'xajax/inc/');
$smarty->assign('ajaxscript',$ajaxscript);
/*
$xajax = new xajax(ROOT_WEB."./class/index.class.php");
$xajax->registerFunction('getCategoryList');
$ajaxscript=$xajax->getJavascript(ROOT_WEB.'./xajax/inc/');
$smarty->assign('ajaxscript',$ajaxscript);
*/
$smarty->assign('loading',$lang['LOADING']);

$smarty->display("article.tpl");
?>